cmake_minimum_required(VERSION 3.6)

set(CMAKE_CXX_STANDARD 14)

set(CMAKE_BUILD_TYPE Release)

# 设置编译标志位 增加了 -fPIC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

project(OkPg)

set(APP_SRC
        OkPgConnection.h
        OkPgException.h
        OkPgPreparedStatement.h
        OkPgResultSet.h
        OkPgUrl.h
        OkPgUtils.h
        OkPool.h
        OkPgConnection.cpp
        OkPgPreparedStatement.cpp
        OkPgResultSet.cpp
        OkPgUrl.cpp
        main.cpp)

add_executable(OkPg  ${APP_SRC})

target_link_libraries(OkPg LINK_PUBLIC pthread)
target_link_libraries(OkPg LINK_PUBLIC glog)
target_link_libraries(OkPg LINK_PUBLIC event)
target_link_libraries(OkPg LINK_PUBLIC pq)
target_link_libraries(OkPg LINK_PUBLIC folly)